/*
@Copyright:LintCode
@Author:   tjyemail
@Problem:  http://www.lintcode.com/problem/unique-characters
@Language: C++
@Datetime: 16-02-09 05:22
*/

class Solution {
public:
    /**
     * @param str: a string
     * @return: a boolean
     */
    bool isUnique(string &str) {
        // write your code here
        bool hash[256]={0};
        for(int i=0;i<str.length();++i){
            if (hash[str[i]])
                return false;
            else
                hash[str[i]]=true;
        }
        return true;
    }
};